]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ibusCandidatePopup: Set OSK candidates list visibility correctly
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 29 Jun 2022 11:06:07 +0000 (13:06 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 29 Jun 2022 13:44:36 +0000 (13:44 +0000)
Right now, we don't pay much attention to visibility hints from IBus
about the candidates list for the OSK suggestions bar. Since some
IMs rely on this visibility being honored, do that.

To fix this, the visibility hints for the lookup table are now
propagated to the keyboard, so the Suggestions actor hides its
internal candidate buttons. Since the Suggestions actor gets its
minimum height from CSS, this does not result in OSK size jumps.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5601
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2347>

js/ui/ibusCandidatePopup.js
js/ui/keyboard.js

index c57e289cbbfba8cd0841f4fd1e04a91421e51076..340f9a8e1a41f1f63ac3d65324d2f99c30a62312 100644 (file)
@@ -270,6 +270,7 @@ class IbusCandidatePopup extends BoxPointer.BoxPointer {
                 indexes.push(indexLabel.get_text());
 
             Main.keyboard.resetSuggestions();
+            Main.keyboard.setSuggestionsVisible(visible);
 
             let candidates = [];
             for (let i = startIndex; i < endIndex; ++i) {
@@ -289,10 +290,12 @@ class IbusCandidatePopup extends BoxPointer.BoxPointer {
             this._candidateArea.updateButtons(lookupTable.is_round(), page, nPages);
         });
         panelService.connect('show-lookup-table', () => {
+            Main.keyboard.setSuggestionsVisible(true);
             this._candidateArea.show();
             this._updateVisibility();
         });
         panelService.connect('hide-lookup-table', () => {
+            Main.keyboard.setSuggestionsVisible(false);
             this._candidateArea.hide();
             this._updateVisibility();
         });
index c819265eb2fe2ec2fa3740eecc46d0fe28eda17e..ac2a800b40648aeb7a02bf5e3fa820809ff7050f 100644 (file)
@@ -227,6 +227,11 @@ class Suggestions extends St.BoxLayout {
     clear() {
         this.remove_all_children();
     }
+
+    setVisible(visible) {
+        for (const child of this)
+            child.visible = visible;
+    }
 });
 
 var LanguageSelectionPopup = class extends PopupMenu.PopupMenu {
@@ -1940,6 +1945,10 @@ var Keyboard = GObject.registerClass({
             this._suggestions.clear();
     }
 
+    setSuggestionsVisible(visible) {
+        this._suggestions?.setVisible(visible);
+    }
+
     addSuggestion(text, callback) {
         if (!this._suggestions)
             return;